import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		requestLoading: false //加载等待是否显示
	},
	mutations: {
		request_show_loading(state) {
			state.requestLoading = true
		},
		request_hide_loading(state) {
			state.requestLoading = false
		}
	},
	actions: {
		async getStore({ commit }) {
			const store = await api('store')
			commit('SET_STORE', store)
		}
	}
})

export default store
